﻿namespace WebHome_API.Models.DataModels
{

    public class PageBase<T>
    {
        public int Page { get; set; }
        public int MaxPage { get; set; }
        public int PerPage { get; set; }
        public int MaxDataCount { get; set; }

        public PageBase(List<T> list, int page, int per)
        {
            this.Page = page;
            this.PerPage = per;
            this.MaxDataCount = list.Count;
            this.MaxPage = MaxDataCount % PerPage == 0 ? MaxDataCount / PerPage : MaxDataCount / PerPage + 1;
        }

    }
}
